package com.wingsboat;

/**
 * @author wangzhong
 * @description: 最长的1；
 * @date 2024/7/22 16:09
 */
public class Test12 {
    public static void main(String[] args){
        int[] arr = {1,0,1,1,1,0,0,1,1,1,0,0};
        int r;
        int l = -1;
        int max = 0;
        for(r =0;r<arr.length;r++){
            if(arr[r]==1){
               max = Math.max(max,r-l);
            }else{
                l = r;
            }
        }
        System.out.println(max);
    }
}
